/*
 * Copyright (c) 2025.
 * All rights reserved.
 */

#ifndef _PC_FT_IOCTL_MESSAGE_H_
#define _PC_FT_IOCTL_MESSAGE_H_

#define MSG_NAME_LENGTH         512

#define MSG_TYPE_EXE_ASK        0x01
#define MSG_TYPE_INSTALL_END    0x02
#define MSG_TYPE_DEBUG_ALL      0x04

#define MSG_TYPE_EXE_ALLOW      0x10
#define MSG_TYPE_EXE_DENY       0x20

#define MSG_STATE_IDLE          0
#define MSG_STATE_BUSY          1
#define MSG_STATE_DEVICE_OK     100

// when name conflict,max retry count
#define IOCTL_MAX_DEVICE_SIZE   16
#define IOCTL_SEND_DEV_NAME     "process_filter_send_"
#define IOCTL_RECV_DEV_NAME     "process_filter_recv_"
#define IOCTL_MSG_ASYNC         CTL_CODE(FILE_DEVICE_UNKNOWN, 0x801, METHOD_BUFFERED, FILE_READ_DATA|FILE_WRITE_DATA)
#define IOCTL_MSG_SYNC          CTL_CODE(FILE_DEVICE_UNKNOWN, 0x802, METHOD_BUFFERED, FILE_READ_DATA|FILE_WRITE_DATA)

#pragma pack(push, 1)
typedef struct _IO_MATCH_MSG {
    SHORT   Id;
    SHORT   Message;
    HANDLE  CurrentPid;
    HANDLE  ParentPid;
    WCHAR   FileName[MSG_NAME_LENGTH];
    USHORT  NameMaxLength;
} IO_MATCH_MSG, * PIO_MATCH_MSG;
#pragma pack(pop)

#endif